from django.shortcuts import render
from rest_framework.generics import ListAPIView
from . import models
from lyapi.settings import contains

from .serializers import BannerModelSerializer
from .serializers import NavModelSerializer


class BannerView(ListAPIView):
    queryset = models.Banner.objects.filter(is_deleted=False, is_show=True)[0:contains.BANNER_LENGTH]
    serializer_class = BannerModelSerializer


class NavView(ListAPIView):
    queryset = models.Nav.objects.filter(is_deleted=False, is_show=True, position=1)[0:contains.NAV_LENGTH]
    serializer_class = NavModelSerializer


